<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="<?php echo base_url();?>public/sites/css/style.css" rel="stylesheet" />
    <?php
	// add css for only page
	if(isset($css)){
		foreach($css as $row){	
			?>
				<link href="<?php echo base_url();?>public/sites/css/<?php echo $row;?>" rel="stylesheet" />
			<?php
		}
	}
	?>
    <script src="<?php echo base_url();?>public/sites/js/jquery-1.11.js" type="text/javascript"></script>
    <script src="<?php echo base_url();?>public/sites/js/menu.js" type="text/javascript"></script>
    <?php
	// add js for only page
	if(isset($js)){
		foreach($js as $row){
			?>
				<script src="<?php echo base_url();?>public/sites/js/<?php echo $row;?>" type="text/javascript"></script>
			<?php
		}
	}
	?>    
	<title><?php echo $title; ?></title>
        <script>
            $(document).ready(function(){
               $("#flag_jp").click(function(){
                   var strURL = "<?php echo base_url()."jp"; ?>";
                   $.ajax({
			url: strURL,
			type: 'POST',
			cache: false,
                        success: function(string){
                            window.location.href=document.URL;
                        }
                   });
               })
               $("#flag_en").click(function(){
                   var strURL = "<?php echo base_url()."en"; ?>";
                   $.ajax({
			url: strURL,
			type: 'POST',
			cache: false,
                        success: function(string){
                            window.location.href=document.URL;
                        }
                   });
               })               
            });
        </script>
</head>

<body>
    <div>
	<div id="header">
            <?php                    
                if($this->session->userdata('Logo') && $this->session->userdata('Logo')!=1){
                    $pathLogo=$this->session->userdata('Logo');
                }elseif($this->session->userdata('Logo')==1){
                    $pathLogo="public/sites/images/logo-company.png";
                }else{    
                    $pathLogo="public/sites/images/logo-ienter.png";
                    
                }
            ?>
    	<img src="<?php echo base_url().$pathLogo ;?>" height="50" />
         <?php if($this->session->userdata('UserName')):?>
        <div id="log_user">
            <label><?php echo $this->lang->line('Home_welcome');?>: </label>
            <a href="<?php echo base_url();?>change-pass"><?php echo $this->session->userdata('UserName'); ?></a>
            <a href="<?php echo base_url();?>logout"><?php echo $this->lang->line('Home_logout');?></a>          
        </div>
        <img id="flag_jp" src="<?php echo base_url();?>public/sites/images/jp.png" height="15" />
        <img id="flag_en" src="<?php echo base_url();?>public/sites/images/eng.png" height="15" />          
        <?php endif;?>
    </div>